package edu.pku.sei.transformation.editor.controller.commands.link;

import edu.pku.sei.transformation.editor.model.CompositeTransformation;
import edu.pku.sei.transformation.editor.model.Transformation;
import edu.pku.sei.transformation.editor.model.TransformationComposition;

public class CompositionDeleteCommand extends AbstractLinkDeleteCommand<TransformationComposition, Transformation, CompositeTransformation> {
	public CompositionDeleteCommand(TransformationComposition link,
			Transformation source, CompositeTransformation target) {
		super(link, source, target);
	}

	@Override
	public void undo() {
		target.getComposition().remove(link);
		link.setComposite(source);
		
	}
	
	@Override
	public void execute() {
		target.getComposition().remove(link);
		link.setComposite(null);
	}

}
